//package com.huonan.test;
//
//import org.openqa.selenium.By;
//import org.openqa.selenium.WebDriver;
//import org.openqa.selenium.WebElement;
//import org.openqa.selenium.chrome.ChromeDriver;
//
//import java.util.List;
//
//public class WebBrowser {
//    public static void main(String[] args) {
////        System.setProperty("webdriver.chrome.driver","/Users/lxp/IdeaProjects/Study/MainTest/src/main/resources" +
////                "/chromedriver");
//        System.setProperty("webdriver.chrome.driver", "/usr/local/bin/chromedriver");
//
//        String url = "https://www.toutiao.com/";
//        WebDriver driver = new ChromeDriver();
//        driver.get(url);
//
//        // 获取文章列表
//        List<WebElement> articleElements = driver.findElements(By.className("article"));
//        for (WebElement articleElement : articleElements) {
//            String articleTitle = articleElement.findElement(By.className("title")).getText();
//            System.out.println("文章标题：" + articleTitle);
//
//            // 打开文章详情页
//            articleElement.findElement(By.className("title")).click();
//
//            // 获取文章评论
//            List<WebElement> commentElements = driver.findElements(By.className("c-comment"));
//            for (WebElement commentElement : commentElements) {
//                String commentAuthor = commentElement.findElement(By.className("author")).getText();
//                String commentContent = commentElement.findElement(By.className("content")).getText();
//                System.out.println("评论作者：" + commentAuthor);
//                System.out.println("评论内容：" + commentContent);
//            }
//        }
//    }
//}